package com.github.thinwonton.spring.web.controller;

import com.github.thinwonton.spring.entity.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/user")
public class UserController {

    @RequestMapping()
    public String showUserForm() {
        return "userForm";
    }

    @RequestMapping("/save")
    @ResponseBody
    public Object saveUser(@RequestBody User user) {
        return user;
    }

}
